-
-
Notifications
You must be signed in to change notification settings - Fork 318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
g.region: add JSON support #3941
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kritibirda26 please address the comments I left in the review and add tests to make sure the JSON format respects the various flag combinations.
@cwhite911 I have updated the PR. |
@cwhite911 the pr is ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checked and proxying @cwhite911's approval
@kritibirda26 is it possible to do a quick PR tomorrow to fix up a newly enforced ruff rule that was merged before your PR but after the last update from main of that branch? There shouldn’t be any fixes available though (for now). |
@echoix Can I disable the inspection for that block using a comment because the alternative rewrite using items would be unnecessarily convoluted? |
Doesn't this work: for key, value in expected.items():
if isinstance(value, float):
self.assertAlmostEqual(value, output_json[key], places=6)
else:
self.assertEqual(value, output_json[key]) |
I'll try that, I thought the error was because of the |
* g.region: add JSON support * add test and documentation * add gmt, wms to output * fix CI build issues * separate projection code and name fields
* g.region: add JSON support * add test and documentation * add gmt, wms to output * fix CI build issues * separate projection code and name fields
Using parson, add JSON support to g.region module.
The output looks like as follows:
The interaction of format option with existing flags needs more looking into. We may want to disallow some combinations.
I will add tests and update documentation once the JSON format is finalized.